package com.pentajock.docdb.listeners;

import java.awt.event.*;
import javax.swing.*;

public class AutoTextSelectionFocusListener extends FocusAdapter {
	private JTextField field;
	
	public AutoTextSelectionFocusListener(JTextField field) {
		this.field = field;
	}
	
	public void focusGained(FocusEvent e) {
		field.setSelectionStart(0);
		field.setSelectionEnd(Integer.MAX_VALUE);
	}
}